<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>1.章节介绍与类型判断</title>
</head>
<body>
  <script>
      let data = {};
      console.log(typeof data); // object
      console.log(data instanceof Object); // true

      let array = [];
      console.log(typeof array); // object
      console.log(data instanceof Array); // true
      console.log(data instanceof Object); // false
      if(data instanceof Object) {
        console.log(data);
      }
      let name;
      console.log(typeof name); // undefined

      let num = 5;
      console.log(typeof num); // number

      let text = "文字";
      console.log(typeof text); // string


      /* 作者: SZX
      链接: https://szxio.gitee.io/hexoblog/JavaScript/ValueType/
      来源: SZX的开发笔记
      */
  </script>
</body>
</html>